package com.project.dao.impl;

import com.project.bean.StudentBean;
import com.project.dao.IStuDao;

import java.sql.SQLException;
import java.util.List;

public class StuDaoImpl extends BaseDao implements IStuDao {
    @Override
    public StudentBean findByClassName() {
        List list = null;
        this.setConnection();
        try {
            ps=con.prepareStatement("select *,c_name from t_student,t_class where pk_classId = fk_classId group by s_name");
            list=(this.getObject(this.ps.executeQuery()));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }finally {
            this.closeConnection();
        }
        return (StudentBean) list;
    }
}
